package feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("product-service")
public interface ProductFeign {
    @GetMapping("/product/{id}")
    Product getByCode(@PathVariable("id") Integer id);

    @PostMapping("/product/update")
    boolean update(@RequestBody Product Product);

    @PostMapping("/product/insert")
    boolean insert(@RequestBody Product Product);

    @PostMapping("/product/delete")
    boolean delete(@RequestParam("id") Integer id);

    @PostMapping("/product/deduct")
    boolean deduct(@RequestParam("productCode") String productCode, @RequestParam("count") Integer count);
}
